package com.gm.springboot.config;

import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
import org.springframework.web.servlet.config.annotation.ViewControllerRegistry;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;

/**
 * @Author Administrator
 * @Date 2020/7/2 13:35
 **/
@Configuration
public class MyConfig {
    @Bean
    public WebMvcConfigurer webMvcConfigurer(){
        WebMvcConfigurer webMvcConfigurer=new WebMvcConfigurer() {
            @Override
            public void addViewControllers(ViewControllerRegistry registry) {
                registry.addViewController("/").setViewName("login");
                registry.addViewController("/login.html").setViewName("login");
                registry.addViewController("/main.html").setViewName("index");
                registry.addViewController("/register.html").setViewName("register");
                registry.addViewController("/studentAdd.html").setViewName("student-add");
                registry.addViewController("/majorAdd.html").setViewName("major-add");
                registry.addViewController("/mangaAdd.html").setViewName("manga-add");
                registry.addViewController("/galgameAdd.html").setViewName("galgame-add");
            }
        };
        return webMvcConfigurer;
    }

}
